@extends('shop::layouts.master')
@section('title')
    列表
@endsection
<style>
    .close{opacity:0; /*position: absolute;*//* top: -5px; right: -3px;*//* background-color:#FFF;*/ /*border-radius: 50%; color: #FFF; padding-top: 1px; */}
    .layui-col-xs3:hover .close{opacity:1;/* background-color: red;*/}
</style>
@section('tab')

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <button class="layui-btn" onclick="xadmin.open('添加','{{route("shop_maintain_shop_create")}}')">
                            <i class="layui-icon"></i>添加
                        </button>
                    </div>
                    <div class="layui-card-body " style="overflow-x: auto;">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>一级分类</th>
                                <th>二级分类</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($data as $key => $value)
                                <tr>
                                    <td style="width:15%">{{$value['f_name']}}</td>
                                    <td style="width:65%">
                                        @foreach($value['son'] as $ky => $val)
                                            @if(!empty($val['name']))
                                            <div class="layui-col-xs3" style="line-height: 40px">
                                                <a title="查看-编辑" class="layui-btn layui-btn-primary layui-btn-xs" onclick="xadmin.open('{{$value["f_name"]}} -> {{$val["name"]}}','{{route('shop_maintain_shop_edit',['id'=>$val['maintain_shop_id']])}}')"> {{$val['custom_title']??$val['name']}} </a>
                                                <a title="配置适用车型" class="close" onclick="xadmin.open('{{$value["f_name"]}} -> {{$val["name"]}} -> 配置适用车型','{{route('shop_maintain_vehicle',['id'=>$val['maintain_shop_id']])}}')" href="javascript:;"><i class="layui-icon"></i></a>
                                                <a title="删除该类" class="close ajax_member_del" data-href="{{route('shop_maintain_shop_delete',['id'=>$val['maintain_shop_id']])}}" data-title="确定删除吗？请谨慎操作" href="javascript:;"><i class="layui-icon"></i></a>
                                            </div>
                                            @endif
                                        @endforeach
                                    <td class="td-manage" style="width:5%">
                                        <a title="删除" class="ajax_member_del layui-btn layui-btn-danger" data-href="{{route('shop_maintain_shop_delete',['id'=>$value['f_id'],'type'=>1])}}" data-title="确定删除吗？请谨慎操作" href="javascript:;">
                                            删除
                                        </a>
                                    </td>
                                </tr>
                            @endforeach
                            @if(empty($data))
                                <td colspan="66" align="center">暂无数据</td>
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$page_link}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection

